package com.quan.common.base.enums;

public enum CRUD {

	UI(1, "ui", "页面"),
	
	ADD(2, "add", "添加"),
	
	DELETE(3, "delete", "删除"),
	
	UPDATE(4, "update", "修改"),
	
	LIST(5, "list", "查询"),
	
	UNKNOWN(6, "unknown", "未知");
	
	private int index ;
	
	private String enName ;
	
	private String zhName ;
	
	
	private CRUD(int index, String enName, String zhName) {
		this.index = index;
		this.enName = enName;
		this.zhName = zhName;
	}
	
	public static String getZhName(int index) {
		for(CRUD actionType : CRUD.values()) {
			if(actionType.getIndex() == index) {
				return actionType.getZhName() ;
			}
		}
		return null ;
	}

	public static String getEnName(int index) {
		for(CRUD actionType : CRUD.values()) {
			if(actionType.getIndex() == index) {
				return actionType.getEnName() ;
			}
		}
		return null ;
	}

	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}

	public String getEnName() {
		return enName;
	}

	public void setEnName(String enName) {
		this.enName = enName;
	}

	public String getZhName() {
		return zhName;
	}

	public void setZhName(String zhName) {
		this.zhName = zhName;
	}
	
	public static void main(String[] args) {
		System.out.println(CRUD.UI.getIndex());
		System.out.println(CRUD.UI.getEnName());
		System.out.println(CRUD.UI.getZhName());
	}
	
	
}
